﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Ideaa.Web.Mappings;
using Ideaa.Data.Mappings;

namespace Ideaa.Web.App_Start
{
    public class AutoMapperConfig
    {
        public static void Configure()
        {
            Mapper.Initialize(config =>
            {
                AddWebMappingsProfiles(config);
                AddDataMappingsProfiles(config);
            });
        }

        private static void AddWebMappingsProfiles(IConfiguration config)
        {
            config.AddProfile<DomainToViewModelMappingProfile>();
            config.AddProfile<ViewModelToDomainMappingProfile>();
        }

        private static void AddDataMappingsProfiles(IConfiguration config)
        {
            config.AddProfile<DomainToPersistedMappingProfile>();
            config.AddProfile<PersistedToDomainMappingProfile>();
        }
    }
}